package com.sen.Midium;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class L006_ZigZag_ConversionTest {
    L006_ZigZag_Conversion test = null;

    @Before
    public void setUp() {
        test = new L006_ZigZag_Conversion();
    }

    @After
    public void tearDown() {
        test = null;
    }

    @Test
    /**
     * Example 1:
     * Input: s = "PAYPALISHIRING", numRows = 3
     * Output: "PAHNAPLSIIGYIR"
     */
    public void testConvert_1() {
        String input = "PAYPALISHIRING";
        String output = "PAHNAPLSIIGYIR";
        assertEquals(output, test.convert(input, 3));
    }

    @Test
    /**
     * Example 2:
     * Input: s = "PAYPALISHIRING", numRows = 4
     * Output: "PINALSIGYAHRPI"
     */
    public void testConvert_2() {
        String input = "PAYPALISHIRING";
        String output = "PINALSIGYAHRPI";
        assertEquals(output, test.convert(input, 4));
    }
}